package io.github.talelin.latticy.vo;

import com.baomidou.mybatisplus.core.metadata.IPage;
import io.github.talelin.latticy.common.enums.ResponseEnum;
import lombok.*;
import org.apache.poi.ss.formula.functions.T;

/**
 * @ClassName：FindResultVO
 * @Author: ljj
 * @Date: 2022/6/7 14:23
 */
@Getter
@Setter
@ToString
public class FindResultVO<T> {
    private Integer code;

    private String msg;

    private T data;


    public static <T> FindResultVO<T> success() {
        FindResultVO<T> result = new FindResultVO<>();
        result.setCode(ResponseEnum.SUCCESS.getCode());
        result.setMsg(ResponseEnum.SUCCESS.getMessage());
        return result;
    }

    public static <T> FindResultVO<T> success(T entry) {
        FindResultVO<T> result = FindResultVO.success();
        result.setData(entry);
        return result;
    }
}
